/**
 * 批改任务类型枚举
 * 
 * @author System
 * @version 2.0.0
 * @since 2025-11-11
 */
package com.edu.exam.enums.grading;

public enum CorrectionTaskType {
    AUDIT_TASK("AuditTask", "审核任务"),
    EXECUTION_TASK("ExecutionTask", "执行任务"),
    NOTIFICATION_TASK("NotificationTask", "通知任务"),
    CLEANUP_TASK("CleanupTask", "清理任务");

    private final String code;
    private final String description;

    CorrectionTaskType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static CorrectionTaskType fromCode(String code) {
        for (CorrectionTaskType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return AUDIT_TASK;
    }
}